const modalChildBehavior = require('../../../behaviors/modalChildBehavior');
Component({
  properties: {
    popviewShow: {
      type: Boolean,
      value: false,
      observer: '_popviewShowChange'
    },
    position: {
      type: String,
      value: 'right'
    },
    width: {
      type: String
    },
    height: {
      type: String
    }
  },
  behaviors: [ modalChildBehavior ],
  methods: {
    closeShade: function () {
      this.setDataSmart({
        popviewShow: false
      })
    },
    _popviewShowChange(newVal, oldValue) {
      if (!newVal) {
        let timer = setTimeout(() => {
          this.setData({
            shadeActive: newVal
          })
          clearTimeout(timer);
        }, 200);
      } else {
        this.setData({
          shadeActive: newVal
        })
      }
    },
    movePrevent: function () {
      console.log('move prevent')
      return;
    }
  }
})